/**
 *******************************************************************************
 * @FileName  : hci_tr_main.h
 * @Author    : GaoQiu
 * @CreateDate: 2020-09-10
 * @Copyright : Copyright(C) GaoQiu
 *              All Rights Reserved.
 *
 *******************************************************************************
 *
 * The information contained herein is confidential and proprietary property of
 * GaoQiu and is available under the terms of Commercial License Agreement
 * between GaoQiu and the licensee in separate contract or the terms desc ribed
 * here-in.
 *
 * This heading MUST NOT be removed from this file.
 *
 * Licensees are granted free, non-transferable use of the information in this
 * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
 *
 *******************************************************************************
 */

#ifndef HCI_TR_MAIN_H_
#define HCI_TR_MAIN_H_

#include "hci_tr_api.h"

#if 0//!HCI_RINGBUF_EN
inline void HCI_TR_TimerInit(uint16_t ms)
{
	TIM_Init(TIM0, TIM_Mode_Sys_Clk);
	TIM_SetCapture(TIM0, ms * 1000 * 32);
	TIM_SetCounter(TIM0, 0);

#if HCI_H4_DMA_MODE_EN
	TIM_Cmd(TIM0, ENABLE);
#endif
}

inline void HCI_TR_TimerEnable(void)
{
	TIM->TIM0_CNT = 0;
	TIM->CTRL_STAT |= TIM_CTRL_TIM0_EN;
}

inline void HCI_TR_TimerDisable(void)
{
	TIM->TIM0_CNT = 0;
	TIM->CTRL_STAT &= ~TIM_CTRL_TIM0_EN;
}
#endif

#endif /* HCI_TR_MAIN_H_ */
